home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
taropyon
/
install
/
_install.cci
next >
Wrap
Text File
|
1993-11-30
|
15KB
|
691 lines
# 1 "install.cci"
# 1 "install.cci"
# 13 "install.cci"
char PltDat[3][16] =
{
{ 0, 0, 0},
{ 0, 0, 0},
{ 7, 7, 8},
{12,12,13},
{ 6, 5, 7},
{ 8, 7, 9},
{10, 9,11},
{11,11,12},
{ 5, 5, 6},
{ 0, 0,11},
{ 0,11, 0},
{ 0,11,11},
{11, 0, 0},
{11, 0,11},
{11,11, 0},
{14,14,15}
};
# 38 "install.cci"
int init()
{
int i;
DSP_sysInit(0);
KBF_sysInit();
KBF_kan_off();
FDL_sysInit();
sdk_control(0);
for ( i = 0; i < 2; ++i )
{
DSP_writePage(i);
DSP_setPlt( PltDat );
}
DSP_writePage(1);
DSP_title("INSTALL","0.99",15,7,0,0);
evt_setDspTime( 1, 432, 4, 7, 0 );
SYL_clear();
}
# 63 "install.cci"
int term()
{
FDL_sysEnd();
KBF_sysEnd();
DSP_sysEnd();
}
char StartPath[256];
char ItmPath[256];
int DlgX0 = (0x20000+((320)&0xFFFF));
int DlgY0 = (0x20000+((320)&0xFFFF));
# 80 "install.cci"
int item_adjust_pos( short *newfrm )
{
if ( newfrm[2] > 621 )
{
newfrm[2] = 621;
newfrm[0] = newfrm[2] - 24;
}
if ( newfrm[3] > 410 )
{
newfrm[3] = 410;
newfrm[1] = newfrm[3] - 24;
}
return ((0));
}
int item_set_newpos( short *newfrm )
{
int ret;
int fpos, nextFPos;
int etyNum;
short icnNum;
char ttlStr[128];
char pathStr[128];
char paraStr[128];
int atrInf;
int nextFPos;
short frm[4];
fpos = 0;
newfrm[0] = 0;
newfrm[1] = 0;
newfrm[2] = 0;
newfrm[3] = 0;
while ( (fpos = ITM_GetPhysclNextFPos( ItmPath, fpos )) > 0 )
{
if ( ITM_GetStair( ItmPath, fpos ) == 0 )
{
ret = ITM_GetItmType(ItmPath,fpos);
switch ( ret )
{
case 1:
ITM_GetGrpData(ItmPath,fpos,&etyNum,&icnNum,ttlStr,&nextFPos,frm);
break;
case 2:
ITM_GetAplData(ItmPath,fpos,&icnNum,ttlStr,pathStr,paraStr,atrInf,frm);
break;
}
if ( newfrm[0] < frm[2] )
newfrm[0] = frm[2];
if ( newfrm[1] < frm[3] )
newfrm[1] = frm[3];
}
}
newfrm[1] = newfrm[1] + 15;
newfrm[2] = newfrm[0] + 24;
newfrm[3] = newfrm[1] + 24;
return (item_adjust_pos( newfrm ));
}
# 144 "install.cci"
int dsp_init(char **msg)
{
int i, len, x, y;
char *p;
DSP_writePage(0);
DSP_boxf(0,24,639,463,0,(0x1000|(((5)&15)<<4)|((6)&15)));
if ( msg )
{
i = 0;
while ( (p = msg[i++]) != 0 )
{
len = strlen(p);
x = (640 - len * 8)/2;
y = 32 + (i * 18);
DSP_str(x,y,1,5,16,p);
}
}
}
# 169 "install.cci"
char *getSizMsg( char *buf, unsigned int siz )
{
static char tmp[32];
float f;
if ( buf == 0 )
buf = tmp;
if ( siz == 0 )
strcpy( buf, "0");
else if ( siz < 1024 )
sprintf( buf, "%u", siz );
else if ( siz < 1024*1024 )
{
f = (float)siz / (float)1024;
sprintf( buf, "%.1fK", f );
} else
{
f = (float)siz / (float)(1024*1024);
sprintf( buf, "%.1fM", f );
}
return (buf);
}
# 5 "hewin.cci"
char *HewinMsg[8] =
{
"HEwin は,テキストエディタ,通信機能\,DOS コンソ\ール,TIFFビュワー",
"等を備えたマルチウィンドゥ環境で動作するアプリケーションです。",
"※ メモリ:要4Mバイト(推奨6~10Mバイト以上)",
"",
" ディスク容量の関係から、フロッピィディスクにはすべてのファイルは ",
" 複写できません(必要最小限のファイルのみが複写されます)。",
0
};
char *HewinFile1[12] =
{
"hewin.exp",
"*.dll",
"hewin.cci",
"hewin.icn",
"hewin.tif",
"tdptmp.tbl",
"*.doc",
"*.hlp",
0
};
char *HewinFile2[8] =
{
"cci.exp",
"rz.exp",
"sz.exp",
0
};
char *HewinFile3[5] =
{
"makecci.bat",
"cpp.exe",
"*.h",
"*.cci",
0
};
# 51 "hewin.cci"
int hewin_install()
{
int i, ret, len;
char *btn;
char *fdl;
int drv;
unsigned int totalFree, writeFree;
char *p, tmp[256], path[256], ccipath[256], whare[256], prog[256];
short frm[4];
char *aplname, *dirname, *srcdir;
aplname = "HEwin";
dirname = "HEWIN";
srcdir = " :/TAROPYON/HEWIN/";
srcdir[0] = StartPath[0];
dsp_init(HewinMsg);
_RETRY:
DSP_writePage(1);
btn = MNU_allocBtn( 2 );
MNU_setBtn( btn, 0, '\r' , 0x7300 , 1, "INSTALL : [実行]" );
MNU_setBtn( btn, 1, '\x1B', 0x7200, 2, "CANECEL : [取消]" );
ret = MNU_selectBtn( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)), (0), 2, btn,
" %s のインストールを行いますか? ", aplname );
MNU_freeBtn( btn );
if ( ret != 1 )
return (0);
DLG_tmpMsgTime( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)),
3, "\n インストール先に移動してください。 \n" );
if ( (fdl = FDL_open(0)) == 0 )
return (-1);
FDL_set_title( fdl,"インストール先指定");
FDL_set_wildcard( fdl, "*.*");
ret = FDL_start(fdl);
if ( ret == (0) )
{
drv = FDL_get_drv(fdl);
strcpy( whare, FDL_get_whare(fdl) );
}
FDL_close(fdl);
if ( ret )
goto _RETRY;
if ( FS_getDskFree( drv, &totalFree, &writeFree) )
{
DLG_tmpMsgTime( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)),
3, " ディスクの準備ができていません。 " );
goto _RETRY;
}
if ( writeFree < 1167*1024 || (drv > 1 && writeFree < 3*1024*1024) )
{
ret = MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)), (1),
" %c: Disk free space %u [%s] byte(s) \n ディスク容量が足りません。 ",
drv + 'A', writeFree, getSizMsg(0,writeFree) );
if ( ret != (1) )
goto _RETRY;
}
sprintf( tmp, "%c:/%s", drv+'A', whare );
len = strlen(tmp);
if ( len > 0 && tmp[len-1] != '/' && tmp[len-1] != '\\' )
{
tmp[len++] = '/';
tmp[len] = '\0';
}
sprintf( path, "%s%s", tmp, dirname );
ret = FS_isFileExist(path);
if ( ret == 0 )
{
btn = MNU_allocBtn( 2 );
MNU_setBtn( btn, 0, '\r' , 0x7300 , 1, "MKDIR : [実行]" );
MNU_setBtn( btn, 1, '\x1B', 0x7200, 2, "CANECEL : [取消]" );
ret = MNU_selectBtn( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)), (1), 2, btn,
" インストール先にディレクトリを作成します。 \n%s", path );
MNU_freeBtn( btn );
if ( ret != 1 )
goto _RETRY;
FS_mkdir(path);
} else if ( ret == 1 )
{
MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)), (1),
" %s \n インストール先に同名のファイルが存在しています。 ", path );
goto _RETRY;
}
btn = MNU_allocBtn( 2 );
MNU_setBtn( btn, 0, '\r' , 0x7300 , 1, "INSTALL : [実行]" );
MNU_setBtn( btn, 1, '\x1B', 0x7200, 2, "CANECEL : [取消]" );
ret = MNU_selectBtn( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)), (1), 2, btn,
"インストール先 : %s\n Disk free space %u [%s] byte(s) \n\n インストールを行いますか? ",
path, writeFree, getSizMsg(0,writeFree) );
MNU_freeBtn( btn );
if ( ret != 1 )
goto _RETRY;
sprintf( tmp, "%s.", srcdir );
FS_chdrv( toupper(srcdir[0]) - 'A' );
FS_chdir( tmp );
ret = i = 0;
while ( (p = HewinFile1[i++]) != 0 && ret == 0 )
{
SYL_puts( 12, "copy %s", p );
ret = FM_fcopy( p, 0x00, (0x01)|(0x80), path, "" );
}
if ( drv > 1 && ret == (0) )
{
ret = i = 0;
while ( (p = HewinFile2[i++]) != 0 && ret == 0 )
{
SYL_puts( 12, "copy %s", p );
if ( FS_isFileExist(p) == 0 )
continue;
ret = FM_fcopy( p, 0x00, (0x01)|(0x80), path, "" );
}
}
if ( drv > 1 && ret == (0) )
{
sprintf( tmp, "%sCCISRC", srcdir );
FS_chdrv( toupper(srcdir[0]) - 'A' );
FS_chdir( tmp );
sprintf( ccipath, "%s/CCISRC", path );
if ( (ret = FS_isFileExist(tmp)) == 0 )
{
FS_mkdir(ccipath);
} else if ( ret == 1 )
{
MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)), (1),
" %s \n インストール先に同名のファイルが存在しています。 ", ccipath );
goto _RETRY;
}
ret = i = 0;
while ( (p = HewinFile3[i++]) != 0 && ret == 0 )
{
SYL_puts( 12, "copy %s", p );
ret = FM_fcopy( p, 0x00, (0x01)|(0x80), ccipath, "" );
}
}
if ( ret )
{
MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)), (1),
"FILE COPY ERROR\n インストールに失敗しました。 " );
return (-1);
}
SYL_puts( 12, "アイテム登録" );
sprintf( ItmPath, "%c:\\tmenu.itm", drv+'A');
if ( FS_isFileExist(ItmPath) == 0 )
{
ITM_CreateItemFile(ItmPath);
}
item_set_newpos( frm );
ret = MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)), (1),
" item file %s \n アイテム登録を行います。 ", ItmPath );
if ( ret == (1) )
{
sprintf( tmp, "%s/%s", path, HewinFile1[0]);
FS_unix2dos( prog, tmp+2 );
FS_strupr( prog );
ITM_AddAplItem( ItmPath, 0, 1024, "HEwin", prog, "", 2, frm );
}
SYL_puts( 12, "***** Completed *****");
DLG_tmpMsgTime( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)),
3, " インストール終了しました。 " );
return (0);
}
# 7 "gsplay.cci"
char *GsplayMsg[12] =
{
"GSPLAYはMIDI用演奏データを演奏するプログラムです。",
"データファイルはスタンダードMIDIファイル(ファイル名の拡張子は.MID)と",
"EUPHONY 形式(ファイル名の拡張子は.EUP)に対応しています。",
"ただし,内蔵音源用に作成されたEUP ファイルは演奏できません。",
"TOWNS の内蔵音源をGS規格相当の音源として動作させることもでき,",
"この場合,GS音源用に作成された演奏データを",
"TOWNS の内蔵音源で再生することができます。",
"※ 内蔵音源で演奏させる場合には別途,音色データファイルが必要です。",
0
};
char *GsplayFile1[6] =
{
"gsplay.exp" ,
"gsplay.doc",
"gstone.dat",
"gsrym.dat",
"*.mex",
0
};
# 54 "gsplay.cci"
int gsplay_install()
{
int i, ret, len;
char *btn;
char *fdl;
int drv;
unsigned int totalFree, writeFree;
char *p, tmp[256], path[256], ccipath[256], whare[256], prog[256];
short frm[4];
char *aplname, *dirname, *srcdir;
int gsdata, gsdev;
aplname = "GSPLAY";
dirname = "GSPLAY";
srcdir = " :/TAROPYON/GSPLAY/";
srcdir[0] = StartPath[0];
dsp_init(GsplayMsg);
_RETRY:
DSP_writePage(1);
btn = MNU_allocBtn( 2 );
MNU_setBtn( btn, 0, '\r' , 0x7300 , 1, "INSTALL : [実行]" );
MNU_setBtn( btn, 1, '\x1B', 0x7200, 2, "CANECEL : [取消]" );
ret = MNU_selectBtn( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)), (0), 2, btn,
" %s のインストールを行いますか? ", aplname );
MNU_freeBtn( btn );
if ( ret != 1 )
return (0);
btn = MNU_allocBtn( 3 );
MNU_setBtn( btn, 0, 'B', 0x2E00, 1 , "Board MIDI :[N]" );
MNU_setBtn( btn, 1, 'R', 0x1400, 2 , "RS-232C MIDI : [R]" );
MNU_setBtn( btn, 2, 'T', 0x1500, 3, "TOWNS only : [T]" );
ret = MNU_selectBtn( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)), (1), 3, btn,
" 使用するMIDIインターフェースを指定してください。\n\n%s\n%s\n%s",
"Board MIDI : FMT-401/402/403,MC-P23T",
"RS-232C MIDI : RS-232C MIDI アダプタ ",
"TOWNS only : 内蔵音源のみ "
);
MNU_freeBtn( btn );
if ( ret < 1 || ret > 3 )
goto _RETRY;
gsdev = ret;
DLG_tmpMsgTime( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)),
3, "\n インストール先に移動してください。 \n" );
if ( (fdl = FDL_open(0)) == 0 )
return (-1);
FDL_set_title( fdl,"インストール先指定");
FDL_set_wildcard( fdl, "*.*");
ret = FDL_start(fdl);
if ( ret == (0) )
{
drv = FDL_get_drv(fdl);
strcpy( whare, FDL_get_whare(fdl) );
}
FDL_close(fdl);
if ( ret )
goto _RETRY;
if ( FS_getDskFree( drv, &totalFree, &writeFree) )
{
DLG_tmpMsgTime( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)),
3, " ディスクの準備ができていません。 " );
goto _RETRY;
}
if ( writeFree < 544*1024 )
{
ret = MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)), (1),
" %c: Disk free space %u [%s] byte(s) \n ディスク容量が足りません。 ",
drv + 'A', writeFree, getSizMsg(0,writeFree) );
if ( ret != (1) )
goto _RETRY;
}
sprintf( tmp, "%c:/%s", drv+'A', whare );
len = strlen(tmp);
if ( len > 0 && tmp[len-1] != '/' && tmp[len-1] != '\\' )
{
tmp[len++] = '/';
tmp[len] = '\0';
}
sprintf( path, "%s%s", tmp, dirname );
ret = FS_isFileExist(path);
if ( ret == 0 )
{
btn = MNU_allocBtn( 2 );
MNU_setBtn( btn, 0, '\r' , 0x7300 , 1, "MKDIR : [実行]" );
MNU_setBtn( btn, 1, '\x1B', 0x7200, 2, "CANECEL : [取消]" );
ret = MNU_selectBtn( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)), (1), 2, btn,
" インストール先にディレクトリを作成します。 \n%s", path );
MNU_freeBtn( btn );
if ( ret != 1 )
goto _RETRY;
FS_mkdir(path);
} else if ( ret == 1 )
{
MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)), (1),
" %s \n インストール先に同名のファイルが存在しています。 ", path );
goto _RETRY;
}
btn = MNU_allocBtn( 2 );
MNU_setBtn( btn, 0, '\r' , 0x7300 , 1, "INSTALL : [実行]" );
MNU_setBtn( btn, 1, '\x1B', 0x7200, 2, "CANECEL : [取消]" );
ret = MNU_selectBtn( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)), (1), 2, btn,
"インストール先 : %s\n Disk free space %u [%s] byte(s) \n\n インストールを行いますか? ",
path, writeFree, getSizMsg(0,writeFree) );
MNU_freeBtn( btn );
if ( ret != 1 )
goto _RETRY;
sprintf( tmp, "%s.", srcdir );
FS_chdrv( toupper(srcdir[0]) - 'A' );
FS_chdir( tmp );
ret = i = 0;
while ( (p = GsplayFile1[i++]) != 0 && ret == 0 )
{
SYL_puts( 12, "copy %s", p );
ret = FM_fcopy( p, 0x00, (0x01)|(0x80), path, "" );
}
if ( ret == (0) )
{
# 249 "gsplay.cci"
if ( gsdev == 3 )
{
MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)), (1),
" 内蔵音源用の音色データファイルは\nインストールされませんので\n別途用意してください。" );
}
}
if ( ret )
{
MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((10)&15)<<4)|((7)&15)), (1),
"FILE COPY ERROR\n インストールに失敗しました。 " );
return (-1);
}
SYL_puts( 12, "アイテム登録" );
sprintf( ItmPath, "%c:\\tmenu.itm", drv+'A');
if ( FS_isFileExist(ItmPath) == 0 )
{
ITM_CreateItemFile(ItmPath);
}
ret = MNU_sure( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)), (1),
" item file %s \n アイテム登録を行います。 ", ItmPath );
if ( ret == (1) )
{
sprintf( tmp, "%s/%s", path, GsplayFile1[0]);
FS_unix2dos( prog, tmp+2 );
FS_strupr( prog );
item_set_newpos( frm );
if ( gsdev == 1 )
{
ITM_AddAplItem( ItmPath, 0, 1024, "GSPLAY/midi", prog, "", 2, frm );
} else if ( gsdev == 2 )
{
ITM_AddAplItem( ItmPath, 0, 1024, "GSPLAY/rs", prog, "-rsmidi -gsPort R", 2, frm );
}
if ( gsdata )
{
frm[0] += 48;
frm[2] += 48;
item_adjust_pos( frm );
ITM_AddAplItem( ItmPath, 0, 1024, "GSPLAY/int", prog, "-intPort A", 2, frm );
}
}
SYL_puts( 12, "***** Completed *****");
DLG_tmpMsgTime( DlgX0, DlgY0,
1, 3, (0x1000|(((12)&15)<<4)|((7)&15)),
3, " インストール終了しました。 " );
return (0);
}
# 201 "install.cci"
char *InstallMsg[8] =
{
" HEwin … 超弩級アプリケーション・プロセッサ HEwin ",
" GSPLAY … MIDI sound display system GSPLAY / [GS] emulation player ",
"",
" EXIT … 終了 ",
0
};
int install()
{
int ret;
char *obj;
char *mnu;
obj = MNU_alloc(4);
MNU_setObj(obj, 0, (2), 'H', "HEwin" , 0,(1) , 0 );
MNU_setObj(obj, 1, (2), 'G', "GSPLAY", 0,(2), 0 );
MNU_setObj(obj, 2, (0), 0 , 0 , 0, 0 , 0 );
MNU_setObj(obj, 3, (2), 'X', "EXit" , 0,(9999) , 0 );
do
{
dsp_init(InstallMsg);
DSP_writePage(1);
mnu = MNU_open( DlgX0, DlgY0, (1), obj, "INSTALLER MENU" );
ret = MNU_start ( mnu );
MNU_close(mnu);
switch ( ret )
{
case (1): hewin_install(); break;
case (2): gsplay_install(); break;
}
} while ( ret >= 0 && ret != (9999) );
MNU_free(obj);
return ((0));
}
# 245 "install.cci"
int main( int argc, char **argv )
{
char tmp[256];
init();
FS_setFullPathname( tmp, argv[0] );
FS_getDnam( StartPath, tmp );
install();
term();
return (0);
}